package com.dhl.fin.api.dto;

import cn.hutool.core.date.DateUtil;
import com.dhl.fin.api.common.util.StringUtil;
import com.dhl.fin.api.enums.WeekEnum;
import lombok.Data;

import java.util.Date;

/**
 * @author CuiJianbo
 * @since 2025/5/19
 */
@Data
public class MensesCalenderDTO {

    private Integer dayNumber;

    private Date day;

    private Date targetDay;

    private String cssClass;

    private String type;

    private Integer index;

    private Boolean isRemind;

    private String remark;

    public NextTimeDTO changeToNextTimeDTO() {
        Date targetDate = null;
        if (StringUtil.isNotEmpty(remark) && remark.contains("前一天")) {
            targetDate = DateUtil.offsetDay(day, -1);
        } else {
            targetDate = day;
        }
        return NextTimeDTO.changeToNextTime(day, targetDate, remark);
    }

}
